package cn.btks.resultintegration.feign.FeignClient;

import cn.btks.commonserver.result.ResultState;
import cn.btks.resultintegration.feign.FeignFallBack.BackManageFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author lijun
 * @Date 2021/2/4 14:25
 */
//@FeignClient(value = "manage-server",url = "${feignUrl.url}",fallback = BackManageFallBack.class)
@FeignClient(value = "manage-server",fallback = BackManageFallBack.class)
public interface BackManageClient {

    /**
     * 获取所有师信息
     * @return
     */
    @GetMapping("api/v1.0/unit/find/city/findAll")
    public ResultState findAllCity();

    /**
     * 根据用户确定是师还是兵团来获取区划信息
     * @return
     */
    @GetMapping("api/v1.0/unit/find/city/findAllByDivision")
    public ResultState findAllByDivision();

    /**
     * 根据ID查询师信息
     * @return
     */
    @GetMapping("api/v1.0/unit/find/city/findById/{id}")
    public ResultState findById(@PathVariable("id") Long id);

    /**
     * 获取所有师下的团场信息
     * @return
     */
    @GetMapping("api/v1.0/unit/find/county/findAllByCityId/{cityId}")
    public ResultState findAllByCityId(@PathVariable("cityId") Long cityId);

    /**
     * 根据名称查询师信息
     * @param cityName
     * @return
     */
    @GetMapping("api/v1.0/unit/find/city/findByCityName/{cityName}")
    public ResultState findByCityName(@PathVariable("cityName") String cityName);

    /**
     * 根据代管师的ID查询其代管团场
     * @param cityId
     * @return
     */
    @GetMapping("api/v1.0/unit/find/county/findAllByEscrowId/{cityId}")
    public ResultState findAllByEscrowId(@PathVariable("cityId") Long cityId);
}
